var icon = "<i class='fa fa-times-circle'></i> ";
$(document).ready(function () {
	$("#actorUpdateForm").validate({
		rules : {
			"actorName" : {
				required : true
			}
		},		
		messages : {
			"actorName" : {
				required : icon + "请输入角色名"
			}
		},
		submitHandler : function(form) {
			var dataJson = JSON.stringify($("#actorUpdateForm").serializeObject());	
			console.log(dataJson);
			LocalAjax({
				url : $(form).attr('action'),
				data : dataJson,
				async : false,
				success : function(data) {
					var result = eval(data);
					if (result.resultCode == '1') {
						parent.layer.msg('保存成功', {icon: 1,time: 1000});
						parent.$("#searchForm").submit();
	               		closeWin();
					} else {
						var message = result.message;
						if (message != "") {
							layer.alert(message);
						} else {
							layer.alert("保存失败");
						}
					}
				}
			});
		}
	});
});